Method, apparatus, device and medium for creating raid
By automatically detecting and selecting server RAID cards and their disk types and capacities, the problem of manual specification of RAID cards and disks being labor-intensive and error-prone is solved, achieving efficient and accurate RAID creation and improving the performance of the server's operating system.
Patent Information
- Application Number
- CN202311041057.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-08-17
AI Technical Summary
Manually specifying RAID array cards and their associated disks in servers is labor-intensive, time-consuming, and prone to errors, resulting in high labor costs, especially when a large number of servers are pre-installed with the KOS operating system.
By detecting the type and quantity of RAID cards and their associated disks in the server, the system automatically determines the RAID creation method, including RAID1, RAID0, and RAID1 creation. It uses the storcli64 and arcconf tools to obtain RAID card information and selects the RAID card and its disks with the optimal capacity for RAID creation.
It enables RAID determination without human intervention, reducing manual workload and costs, improving accuracy and efficiency, and ensuring the consistency and high performance of RAID creation.
Smart Images

Figure CN117111844B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for creating RAID, an apparatus for creating RAID, an electronic device, and a readable storage medium. Background Technology
[0002] With the rapid development of technology, servers are being used more and more widely across various industries. Consequently, the demand for servers is increasing significantly, and consequently, the requirements for server operating systems are also rising. Currently, many customers require that the KOS operating system be pre-installed on their ordered servers so that they can use it to process data later.
[0003] KOS, a server operating system, supports multiple chip architectures and computing scenarios, including x86 and ARM, making it a server operating system for the intelligent computing era. Through hardware and software co-optimization, KOS-based applications in artificial intelligence, virtualization, and cloud-native computing have seen enhanced development efficiency, operational efficiency, and scalability. It effectively improves system maintainability and supports hot upgrades of the kernel and application software. KOS has become the preferred choice for industry users, making its promotion in the server field highly valuable.
[0004] However, before pre-installing the KOS operating system on the server, a RAID (Redundant Array of Independent Disks) needs to be created on the server, and then the KOS operating system is installed on the RAID.
[0005] RAID combines multiple relatively inexpensive hard drives into a single array using a RAID controller, enabling the array to achieve performance equal to or even exceeding that of a single, expensive, high-capacity hard drive. Depending on the chosen RAID level, RAID offers one or more advantages over a single hard drive, including enhanced data integration, improved fault tolerance, and increased processing power or capacity.
[0006] Servers sometimes come pre-installed with multiple RAID array cards, such as LSI or PMC cards, each paired with different disks. Therefore, before creating a RAID array, it's necessary to determine which RAID array card and its associated disks will be used. Once the target RAID array card and its associated disks are identified, the RAID array is then created based on these specifications.
[0007] Currently, when determining which RAID array card and its associated disk to create a RAID array, staff can manually specify the RAID array card and its associated disk on the server. However, as the number of servers requiring pre-installed KOS increases, the RAID array cards in each server are not entirely the same, and the disks associated with different RAID array cards in the same server are also not entirely the same. Therefore, manually specifying which RAID array card and its associated disk to create a RAID array on each server is labor-intensive, time-consuming, error-prone, and has high labor costs. Summary of the Invention
[0008] To address the aforementioned problems, this application provides a method for creating RAID, an apparatus for creating RAID, an electronic device, and a readable storage medium.
[0009] This invention provides a method for creating a RAID array, applied to a server, the method comprising: The server is checked to see if a first RAID card exists that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disks are at least solid-state drives or hard disk drives. In the case where a first RAID card exists in the server and is paired with only two disks, RAID1 is created based on the first RAID card and the two disks paired with the first RAID card. or, If there is no first RAID card in the server that is paired with only two disks, check if there is a second RAID card in the server that is paired with only one disk. In the case where a second RAID card exists in the server and is paired with only one disk, create a RAID0 array based on the second RAID card and the disk paired with the second RAID card. or, If there is no second RAID card in the server and it is only equipped with one disk, check if there is a third RAID card in the server equipped with three or more disks; In the case of a server with a third RAID card that has three or more disks, RAID1 is created based on the third RAID card and two disks of the same type from the three or more disks that the third RAID card is paired with.
[0010] In one alternative implementation, there are multiple first RAID cards in the server that are paired with only two disks; The process of creating RAID1 based on the first RAID card and the two disks paired with the first RAID card includes: Detect whether there is a first RAID card with two solid-state drives among multiple first RAID cards; In the case where there is a first array card with two solid-state drives among multiple first array cards, RAID1 is created based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card with two solid-state drives. or, In the case where there is no RAID card with two solid-state drives among the multiple RAID cards, detect whether there is a RAID card with two mechanical hard drives among the multiple RAID cards; In the case where there is a first array card with two mechanical hard drives among multiple first array cards, RAID1 is created based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card with two mechanical hard drives.
[0011] In one optional implementation, there are at least two first RAID cards with two solid-state drives; The creation of RAID 1 based on a first RAID card with two solid-state drives and the two solid-state drives paired with the first RAID card with two solid-state drives includes: Choose the first RAID card with the lowest total capacity among at least two RAID cards that are paired with two solid-state drives; Create a RAID 1 array based on the selected first RAID card and the two solid-state drives paired with it.
[0012] In one optional implementation, there are at least two first RAID cards equipped with two mechanical hard drives; The process of creating RAID 1 based on a first RAID card with two hard drives and the two hard drives paired with the first RAID card with two hard drives includes: Choose the RAID card with the lowest total capacity among at least two RAID cards that are paired with two mechanical hard drives; Create a RAID 1 array based on the selected first RAID card and the two mechanical hard drives paired with it.
[0013] In one alternative implementation, there are multiple second RAID cards in the server, each paired with a disk. The process of creating RAID 0 based on the second RAID card and a disk paired with the second RAID card includes: Detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; In the case where there is a second RAID card with a solid-state drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a solid-state drive and the solid-state drive paired with the second RAID card with a solid-state drive. or, If there is no second RAID card with a solid-state drive among the multiple second RAID cards, check if there is a second RAID card with a mechanical hard drive among the multiple second RAID cards; In the case where there is a second RAID card with a mechanical hard drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a mechanical hard drive and the mechanical hard drive paired with the second RAID card with a mechanical hard drive.
[0014] In one optional implementation, there are at least two second RAID cards, each equipped with a solid-state drive. The creation of RAID 0 based on a second RAID card with a solid-state drive and a solid-state drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one solid-state drive; Create a RAID 0 array based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
[0015] In one optional implementation, at least two second RAID cards are used, each paired with a mechanical hard drive. The creation of RAID 0 based on a second RAID card with a mechanical hard drive and a mechanical hard drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one mechanical hard drive; Create a RAID 0 array based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
[0016] In one alternative implementation, there are multiple third RAID cards in the server, each with three or more disks. The creation of RAID 1 based on a third RAID card and two or more disks of the same type paired with the third RAID card includes: Detecting whether there are paired disks, including two solid-state drives, in multiple third-party RAID cards; In the case where there are multiple third RAID cards, there is a third RAID card with two solid-state drives as its paired disks, and a third RAID card with two solid-state drives paired with two solid-state drives is used to create RAID1. or, In the case where there is no third RAID card with paired disks including two solid-state drives among multiple third RAID cards, detect whether there is a third RAID card with paired disks including two hard disks among multiple third RAID cards. In the case where there are multiple third-array cards with paired disks including two mechanical hard drives, RAID1 is created based on the third-array card with paired disks including two mechanical hard drives and the two mechanical hard drives paired with the third-array card with paired disks including two mechanical hard drives.
[0017] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two solid-state drives. The step of creating RAID 1 based on a third RAID card with two solid-state drives (SSDs) and the two SSDs paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two solid-state drives paired with it.
[0018] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The creation of RAID 1 based on a third RAID card with two mechanical hard drives and the two mechanical hard drives paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two mechanical hard drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two mechanical hard drives paired with it.
[0019] This invention provides an apparatus for creating RAID, applied to a server, the apparatus comprising: The first detection module is used to detect whether there is a first RAID card in the server that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disk type includes at least solid-state drives or hard disk drives. The first creation module is used to create RAID1 based on the first array card and the two disks paired with the first array card when there is a first array card in the server that is paired with only two disks. or, The second detection module is used to detect whether a second RAID card with only one disk exists in the server when there is no first RAID card with only two disks in the server. The second creation module is used to create RAID0 based on the second array card and the disk paired with the second array card when there is a second array card in the server that is paired with only one disk. or, The third detection module is used to detect whether there is a third RAID card with three or more disks in the server when there is no second RAID card with only one disk in the server. The third creation module is used to create RAID1 based on the third RAID card and two disks of the same type from the three or more disks that the third RAID card is paired with when there is a third RAID card in the server.
[0020] In one alternative implementation, there are multiple first RAID cards in the server that are paired with only two disks; The first creation module includes: The first detection unit is used to detect whether there is a first array card with two solid-state drives among the multiple first array cards; The first creation unit is used to create RAID1 based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card when there are multiple first array cards with two solid-state drives. or, The second detection unit is used to detect whether there is a first array card with two mechanical hard drives among the multiple first array cards when there is no first array card with two solid-state drives among the multiple first array cards. The second creation unit is used to create RAID1 based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card when there are multiple first array cards.
[0021] In one optional implementation, there are at least two first RAID cards with two solid-state drives; The first creation unit includes: The first selection subunit is used to select the first RAID card with the lowest total capacity of the paired solid-state drives from at least two first RAID cards paired with two solid-state drives. The first creation sub-unit is used to create RAID 1 based on the selected first RAID card and the two solid-state drives paired with the selected first RAID card.
[0022] In one optional implementation, there are at least two first RAID cards equipped with two mechanical hard drives; The second creation unit includes: The second selection subunit is used to select the first RAID card with the lowest total capacity of the paired mechanical hard drives from at least two first RAID cards paired with two mechanical hard drives. The second creation sub-unit is used to create RAID1 based on the selected first RAID card and the two mechanical hard drives paired with the selected first RAID card.
[0023] In one alternative implementation, there are multiple second RAID cards in the server, each paired with a disk. The second creation module includes: The third detection unit is used to detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; The third creation unit is used to create RAID0 based on the second array card with a solid-state drive and the solid-state drive associated with the second array card when there is a second array card with a solid-state drive among multiple second array cards; or, The fourth detection unit is used to detect whether there is a second array card with a mechanical hard drive among the multiple second array cards when there is no second array card with a solid-state drive among the multiple second array cards. The fourth creation unit is used to create RAID0 based on the second array card with a mechanical hard drive and the mechanical hard drive associated with the second array card with a mechanical hard drive when there are multiple second array cards.
[0024] In one optional implementation, there are at least two second RAID cards, each equipped with a solid-state drive. The third creation unit includes: The third selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one solid-state drive; The third creation sub-unit is used to create RAID 0 based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
[0025] In one optional implementation, at least two second RAID cards are used, each paired with a mechanical hard drive. The fourth creation unit includes: The fourth selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one mechanical hard drive; The fourth creation sub-unit is used to create RAID 0 based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
[0026] In one alternative implementation, there are multiple third RAID cards in the server, each with three or more disks. The third creation module includes: The fifth detection unit is used to detect whether there are any third RAID cards with paired disks, including two solid-state drives; The fifth creation unit is used to create RAID1 based on the third array card with two solid-state drives and the two solid-state drives associated with the third array card when there are multiple third array cards with paired disks including two solid-state drives. or, The sixth detection unit is used to detect whether there is a third RAID card with two mechanical hard drives among the multiple third RAID cards when there is no matching disk among the multiple third RAID cards. The sixth creation unit is used to create RAID1 based on the third RAID card with two mechanical hard drives and the two mechanical hard drives associated with the third RAID card when there are multiple third RAID cards with paired disks.
[0027] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two solid-state drives. The fifth creation unit includes: The fifth selection subunit is used to select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks, including two solid-state drives. The fifth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two solid-state drives paired with the selected third RAID card.
[0028] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The sixth creation unit includes: The sixth selection subunit is used to select the third RAID card with the lowest total capacity of the two paired hard disks among at least two paired disks, including two mechanical hard disks. The sixth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two mechanical hard drives paired with the selected third RAID card.
[0029] This invention provides an electronic device, characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor, when executing a program stored in memory, implements the method described above.
[0030] This invention provides a readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the method described above.
[0031] This application enables fully automated determination of which RAID array card and its associated disk to create the RAID array, eliminating the need for human intervention. This reduces manual workload and labor costs. Furthermore, the elimination of human intervention overcomes the possibility of human error, thereby improving the accuracy and efficiency of the determination process.
[0032] Secondly, a unified determination method is used for all batches of servers that need to be shipped. The granularity of the determination method is all servers, not just the batch of production servers. Different determination methods do not need to be set for different batches of servers. The number of determination methods that need to be set is small. Thus, the workload required to set the determination method is low and the method is highly universal. Attached Figure Description
[0033] Figure 1 A flowchart illustrating the steps of a method for creating a RAID according to an embodiment of the present invention is shown. Figure 2 A schematic diagram illustrating the order of selecting the array card and disks according to an embodiment of the present invention is shown; Figure 3 A structural block diagram of an apparatus for creating RAID is shown in one embodiment of the present invention; Figure 4 A structural block diagram of an electronic device provided by an embodiment of the present invention is shown. Detailed Implementation
[0034] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] Before introducing the solution of this application, the technical terms that may be involved in this application will be explained.
[0036] KOS: A server operating system.
[0037] LSI RAID controller: Broadcom's RAID controller, commonly available in series such as 9440, 9460, and 9560.
[0038] PMC RAID card: Adaptec's RAID controller, commonly available in the market are the 8222, 8202 series cards, etc.
[0039] storcli64: A tool for LSI RAID cards used in the system OS. This tool can be used to implement different levels of RAID such as RAID1 and RAID0.
[0040] arcconf: A tool used by PMC RAID cards in the system OS, which can be used to implement different levels of RAID such as RAID1 and RAID0.
[0041] PXE: Pre-boot Execution Environment, is a protocol designed by Intel that allows a computer to download a boot image from a remote server over a network and load installation files or the entire operating system.
[0042] BOM is an abbreviation for Bill of Materials, commonly used in manufacturing, industrial design, and electronic device design. A BOM generally refers to a list that details the components of a product, including the quantity, specifications, and description of each part.
[0043] Reference Figure 1 The diagram illustrates a flowchart of a method for creating a RAID array according to an embodiment of the present invention, applied to a server. The method includes: In step S101, it is detected whether a first RAID card exists in the server, paired with only two disks. The two disks paired with the first RAID card are of the same type. The disk types include at least solid-state drives (SSDs) or hard disk drives (HDDs).
[0044] You can first detect the type of RAID card present on the server. The RAID card types include LSI RAID cards or PMC RAID cards.
[0045] For LSI RAID cards present on the server, the storcli64 tool can be used to retrieve relevant information about the LSI RAID card.
[0046] For example, the storcli64 tool can retrieve the type of RAID card present on the server (in this case, the type is LSI). The storcli64 tool can also retrieve the index number of the LSI RAID card (different RAID cards on the server have different index numbers), the model of the disk paired with the LSI RAID card, the number of disks paired with the LSI RAID card, the type of disk paired with the LSI RAID card (the disk type includes solid-state drives and hard disk drives, etc.), the capacity of the disk paired with the LSI RAID card, and whether the LSI RAID card is paired with only one type of disk (or whether the LSI RAID card is paired with only solid-state drives).
[0047] The retrieved information about the LSI array card can be represented by a data structure, for example, the data structure can be as follows: lsi=${i}|model=${model}|num=${num}|onlyincard=${only}|type=${type}|size=${size} LSI represents the type of RAID card. The part separated by "|" after "=" represents the following: LSI RAID card index number, the model of the disk that is paired with the LSI RAID card, the number of disks that are paired with the LSI RAID card, whether the LSI RAID card is paired with only one type of disk (or whether the LSI RAID card is paired with only solid-state drives), the type of disk that is paired with the LSI RAID card, and the capacity of the disk that is paired with the LSI RAID card.
[0048] For example, in one instance, there are two LSI array cards on the server.
[0049] The relevant information for the two LSI array cards retrieved using the storcli64 tool is shown below: lsi=0|model=MZ7L3480HCHQ-00B7C|num=2|onlyincard=0|type=SSD|size=446.625GB.
[0050] lsi=1|model=ST6000NM019B-2TG103|num=12|onlyincard=0|type=HDD|size=5.457TB.
[0051] For PMC RAID cards present on the server, the arcconf tool can be used to retrieve relevant information about the PMC RAID cards.
[0052] For example, the arcconf tool can retrieve the type of RAID card present on the server (in this case, the type is PMC). The arcconf tool can also retrieve the index number of the PMC RAID card (different RAID cards on the server have different index numbers), the model of the disk paired with the PMC RAID card, the number of disks paired with the PMC RAID card, the type of disks paired with the PMC RAID card (disk types include solid-state drives and hard disk drives, etc.), the capacity of the disks paired with the PMC RAID card, and whether the PMC RAID card is paired with only one type of disk (or whether the PMC RAID card is paired with only solid-state drives).
[0053] The retrieved information about the PMC RAID card can be represented by a data structure, for example, the data structure can be as follows: pmc=${i}|model=${model}|num=${num}|onlyincard=${only}|type=${type}|size=${size}.
[0054] PMC refers to the type of RAID card. The part separated by "|" after "=" represents the following: the index number of the PMC RAID card, the model of the disk that the PMC RAID card is paired with, the number of disks that the PMC RAID card is paired with, whether the PMC RAID card is paired with only one type of disk (or whether the PMC RAID card is paired with only solid-state drives), the type of disk that the PMC RAID card is paired with, and the capacity of the disk that the PMC RAID card is paired with.
[0055] For example, in one instance, there is a PMC array card on the server.
[0056] The following is the relevant information of a PMC RAID card retrieved using the arcconf tool: pmc=1|model=ST16000NM000J-2TW103|num=13|onlyincard=1|type=HDD|size=15259648MB.
[0057] If the LSI RAID card is paired with two disks in its information and the disks are of the same type (e.g., both are solid-state drives or both are hard disks), then this LSI RAID card can be identified as the first RAID card paired with only two disks.
[0058] Alternatively, if the PMC RAID card is paired with two disks in the relevant information of the PMC RAID card and the disks are of the same type (e.g., both are solid-state drives or both are hard disks), then this PMC RAID card can be identified as the first RAID card paired with only two disks.
[0059] In the case where a first RAID card exists in the server and is paired with only two disks, in step S102, RAID1 is created based on the first RAID card and the two disks paired with the first RAID card.
[0060] In one embodiment of this application, the server has one first RAID card that is paired with only two disks, and RAID1 can be created based on this one first RAID card and the two disks paired with this one first RAID card.
[0061] In another embodiment of this application, there are multiple first RAID cards in the server, each paired with only two disks. Thus, one first RAID card can be selected from among the multiple first RAID cards, and then RAID 1 can be created based on the selected first RAID card and the two disks paired with it.
[0062] The types of disks that can be paired with an RAID card include solid-state drives (SSDs) or hard disk drives (HDDs).
[0063] In this way, it is possible to detect whether there is a first RAID card with two solid-state drives among multiple first RAID cards.
[0064] In the information about the first LSI type RAID card, if the number of disks paired with the first LSI type RAID card is 2 and the type of disks is solid-state drives, it can be determined that this first LSI type RAID card is a first RAID card paired with two solid-state drives.
[0065] Alternatively, if the information about the first RAID card of type PMC shows that the number of disks it is paired with is 2 and the type of disks is solid-state drives (SSDs), then it can be determined that this first RAID card of type PMC is a first RAID card paired with two SSDs.
[0066] In the case of a RAID 1 array with two solid-state drives (SSDs) among multiple RAID 1 array cards, a RAID 1 array can be created based on the RAID 1 array with two SSDs and the two SSDs associated with the RAID 1 array with two SSDs.
[0067] For example, in one example, among multiple first array cards, a first array card with two solid-state drives is considered as one. Thus, RAID1 can be created based on this first array card with two solid-state drives and the two solid-state drives paired with this first array card.
[0068] Alternatively, in another example, among multiple RAID controllers, at least two RAID controllers are paired with two solid-state drives (SSDs). In this case, the RAID controller with the lowest total SSD capacity can be selected from these two RAID controllers. Then, a RAID 1 array is created based on the selected RAID controller and its paired SSDs. This minimizes the storage space occupied by creating the RAID 1 array, freeing up more storage space for other server tasks and improving storage utilization.
[0069] Alternatively, if there is no RAID card with two solid-state drives among the multiple RAID cards, it is possible to detect whether there is a RAID card with two mechanical hard drives among the multiple RAID cards.
[0070] If the information about the first LSI type RAID card shows that the first LSI type RAID card is paired with two disks, and both disks are mechanical hard drives, then it can be determined that this first LSI type RAID card is a first RAID card paired with two mechanical hard drives.
[0071] Alternatively, if the information about the first RAID card of type PMC shows that the number of disks it is paired with is 2 and the type of disks is mechanical hard drives, then it can be determined that this first RAID card of type PMC is a first RAID card paired with two mechanical hard drives.
[0072] In the case of a RAID 1 array where there is a RAID 1 array with two mechanical hard drives, a RAID 1 array can be created based on the RAID 1 array with two mechanical hard drives and the two mechanical hard drives paired with the RAID 1 array with two mechanical hard drives.
[0073] For example, in one example, among multiple first array cards, there is one first array card with two mechanical hard drives. In this way, RAID1 can be created based on this first array card with two mechanical hard drives and the two mechanical hard drives paired with this first array card.
[0074] Alternatively, in another example, among multiple RAID controllers, at least two are paired with two hard drives. In this case, the RAID controller with the lowest total capacity of its paired hard drives can be selected from these two options. Then, a RAID 1 array is created based on the selected RAID controller and its paired hard drives. This minimizes the storage space occupied by creating the RAID 1 array, allowing more storage space to be used for other server tasks, thus improving storage utilization.
[0075] In this application, RAID 1 is first created using a first RAID card with two solid-state drives and two solid-state drives paired with the first RAID card. If there is no first RAID card with two solid-state drives among the multiple first RAID cards, RAID 1 is then created using a first RAID card with two hard disk drives and two hard disk drives paired with the first RAID card. In this way, the RAID 1 created can be made to be on solid-state drives as much as possible. The performance of solid-state drives is often higher than that of hard disk drives. Thus, the performance of the created RAID 1 can be maximized, thereby improving the performance of the KOS system pre-installed on the created RAID 1.
[0076] In this application, the RAID levels include: RAID0, RAID1, RAID0+1, RAID1+0, RAID3, RAID4, RAID5 and RAID6. The most common are RAID0, RAID1 and RAID5. The number of disks required for each RAID level is different. For example, RAID0 can be created using 1 disk, RAID1 can be created using 2 disks, and RAID6 can be created using 3 or 4 disks.
[0077] If there is no first RAID card in the server that is paired with only two disks, in step S103, it is detected whether there is a second RAID card in the server that is paired with only one disk.
[0078] If the number of disks paired with the LSI RAID card in the relevant information of the LSI RAID card is 1, it can be determined that this LSI RAID card is a second RAID card paired with only one disk.
[0079] Alternatively, if the number of disks paired with the PMC RAID card is 1 in the relevant information of the PMC RAID card, it can be determined that this PMC RAID card is a second RAID card paired with only one disk.
[0080] In step S104, if a second RAID card exists in the server and is paired with only one disk, RAID0 is created based on the second RAID card and the disk paired with the second RAID card.
[0081] In one embodiment of this application, if there is only one second RAID card in the server that is paired with one and only one disk, then RAID0 can be created based on this one second RAID card and the disk paired with this one second RAID card.
[0082] In another embodiment of this application, the server may have multiple second RAID cards paired with one disk. Thus, one second RAID card can be selected from among the multiple second RAID cards, and then a RAID 0 array can be created based on the selected second RAID card and the two disks paired with it.
[0083] The types of disks that can be paired with an RAID card include solid-state drives (SSDs) or hard disk drives (HDDs).
[0084] In this way, it is possible to detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards.
[0085] In the information about the LSI type second RAID card, if the number of disks paired with the LSI type second RAID card is 1 and the type of disk is solid-state drive, it can be determined that this LSI type second RAID card is a second RAID card paired with one solid-state drive.
[0086] Alternatively, if the information about the PMC type second RAID card indicates that the number of disks paired with the PMC type second RAID card is 1 and the type of disk is a solid-state drive (SSD), then it can be determined that this PMC type second RAID card is a second RAID card paired with a single SSD.
[0087] In the case of a second RAID card with a solid-state drive (SSD) among multiple second RAID cards, a RAID 0 array can be created based on the second RAID card with a SSD and the SSD associated with the second RAID card with a SSD.
[0088] For example, in one example, among multiple second RAID cards, there is one second RAID card paired with a solid-state drive. In this way, RAID0 can be created based on this second RAID card paired with a solid-state drive and the solid-state drive paired with this second RAID card.
[0089] Alternatively, in another example, among multiple secondary RAID controllers, at least two are paired with a single solid-state drive (SSD). In this case, the RAID 0 array can be created by selecting the secondary RAID controller with the lowest SSD capacity from the at least two paired with one SSD, and then using the selected secondary RAID controller and its paired SSD. This minimizes the storage space occupied by creating the RAID 0 array, freeing up more storage space for other server tasks and improving storage utilization.
[0090] Alternatively, if there is no second RAID card with a solid-state drive among the multiple second RAID cards, it is possible to detect whether there is a second RAID card with a mechanical hard drive among the multiple second RAID cards.
[0091] In the information about the LSI type second RAID card, if the number of disks paired with the LSI type second RAID card is 1 and the type of disk is a mechanical hard drive, it can be determined that this LSI type second RAID card is a second RAID card paired with one mechanical hard drive.
[0092] Furthermore, if the number of disks paired with the PMC type second RAID card is 1 and the type of disk is a mechanical hard drive, then it can be determined that this PMC type second RAID card is a second RAID card paired with one mechanical hard drive.
[0093] When there is a second RAID card with a mechanical hard drive among multiple second RAID cards, RAID 0 can be created based on the second RAID card with a mechanical hard drive and the mechanical hard drive paired with the second RAID card with a mechanical hard drive.
[0094] For example, in one example, among multiple second RAID cards, there is one second RAID card paired with a mechanical hard drive. In this way, RAID0 can be created based on this second RAID card paired with a mechanical hard drive and the mechanical hard drive paired with this second RAID card.
[0095] Alternatively, in another example, among multiple first RAID cards, there are at least two second RAID cards paired with a single mechanical hard drive. This allows selecting the second RAID card with the lowest-capacity mechanical hard drive from among the at least two paired cards. Then, a RAID 0 array is created based on the selected second RAID card and its paired mechanical hard drive. This minimizes the storage space occupied by creating the RAID 0 array, freeing up more storage space for other server tasks and improving storage utilization.
[0096] In this application, RAID 0 is first created using a second RAID card with a solid-state drive (SSD) and a SSD paired with the second RAID card. If no second RAID card with an SSD is available, RAID 0 is then created using a second RAID card with a hard disk drive (HDD) and a HDD paired with the second RAID card. This maximizes the performance of the created RAID 0 on the SSD, which typically outperforms HDDs. This approach aims to improve the performance of the created RAID 0 and, consequently, the performance of the KOS system pre-installed on the created RAID 0.
[0097] If there is no second RAID card in the server and it is only equipped with one disk, in step S105, it is detected whether there is a third RAID card in the server equipped with three or more disks.
[0098] If the number of disks paired with the LSI RAID card is 3 or more in the relevant information of the LSI RAID card, it can be determined that this LSI RAID card is a third RAID card paired with three or more disks.
[0099] Alternatively, if the number of disks paired with the PMC RAID card is 3 or more in the relevant information of the PMC RAID card, it can be determined that this PMC RAID card is a third RAID card paired with three or more disks.
[0100] In the case where there is a third RAID card in the server with three or more disks, in step S106, RAID1 is created based on the third RAID card and two disks of the same type from the three or more disks that are paired with the third RAID card.
[0101] In one embodiment of this application, a third RAID card in a server is configured with three or more disks, and at least two of the disks are of the same type. RAID 1 can then be created based on this third RAID card and two of the three or more disks configured with this third RAID card that are of the same type.
[0102] In one embodiment of this application, there are multiple third RAID cards in the server, each equipped with three or more disks, and at least two of the disks are of the same type. A third RAID card can be selected from among the multiple third RAID cards, and then RAID1 can be created based on the selected third RAID card and two of the three or more disks of the same type that are equipped with the selected third RAID card.
[0103] The types of disks that can be paired with an RAID card include solid-state drives (SSDs) or hard disk drives (HDDs).
[0104] In this way, it is possible to detect whether there is a third RAID card among multiple third RAID cards that is paired with disks including two solid-state drives.
[0105] In the case where the number of disks paired with the LSI-type third RAID card is 3 or more and the type of disks is solid-state drive (SSD) in the relevant information of the LSI-type third RAID card, it can be determined that this LSI-type third RAID card is a third RAID card with two SSDs as its paired disks.
[0106] Alternatively, if the number of disks paired with the PMC type third RAID card in the relevant information of the PMC type third RAID card is 3 or more and the type of disks paired with it is solid-state drives, it can be determined that this PMC type third RAID card is a third RAID card with two solid-state drives paired with it.
[0107] In the case of multiple third-array cards, there are third-array cards with two solid-state drives (SSDs) as their paired disks. RAID 1 can be created based on the third-array card with two SSDs as its paired disks and the two SSDs paired with the third-array card with two SSDs as its paired disks.
[0108] For example, in one instance, among multiple third-array cards, one third-array card is configured with two solid-state drives (SSDs). Thus, RAID 1 can be created using this single third-array card with two SSDs and the two SSDs associated with this single third-array card.
[0109] Alternatively, in another example, among multiple third-array cards, at least two of them are paired with disks including two SSDs. In this case, the third-array card with the lowest total capacity of the two SSDs can be selected from the at least two paired third-array cards. Then, RAID 1 is created based on the selected third-array card and the two SSDs paired with it. This minimizes the storage space occupied by creating the RAID 1 array, freeing up more storage space for other server tasks and improving storage utilization.
[0110] Alternatively, if there is no matching disk among the multiple third RAID cards that includes two solid-state drives, it is possible to detect whether there is a matching disk among the multiple third RAID cards that includes two mechanical hard drives.
[0111] In the information about LSI-type third RAID cards, if the number of disks paired with the LSI-type third RAID card is 3 or more and the type of disks paired with it is mechanical hard disk, it can be determined that this LSI-type third RAID card is a third RAID card paired with two mechanical hard disks.
[0112] Alternatively, if the information about the PMC type third RAID card indicates that the number of disks paired with the PMC type third RAID card is 3 or more and the type of disks paired with it is mechanical hard drives, then it can be determined that this PMC type third RAID card is a third RAID card with two mechanical hard drives paired with it.
[0113] In the case of multiple third-array cards, there are third-array cards with two mechanical hard drives as their paired disks. RAID 1 can be created based on the third-array card with two mechanical hard drives as its paired disks and the two mechanical hard drives paired with the third-array card with two mechanical hard drives.
[0114] For example, in one example, among multiple third-array cards, one third-array card is paired with two mechanical hard drives. Thus, RAID1 can be created based on this third-array card paired with two mechanical hard drives and the two mechanical hard drives paired with this third-array card.
[0115] Alternatively, in another example, among multiple third-array cards, at least two of them consist of two mechanical hard drives. In this case, the third-array card with the lowest total capacity of the two mechanical hard drives can be selected from the at least two paired third-array cards. Then, RAID 1 is created based on the selected third-array card and the two mechanical hard drives paired with it. This minimizes the storage space occupied by creating RAID 1, allowing more storage space to be used for other server tasks, thus improving storage utilization.
[0116] In this application, RAID 1 is preferentially created based on a third RAID card with two solid-state drives (SSDs) and the two SSDs associated with that third RAID card. If no third RAID card with two SSDs is available, RAID 1 is created based on a third RAID card with two hard disk drives (HDDs) and the two HDDs associated with that third RAID card. This maximizes the performance of the created RAID 1 array on SSDs, which generally outperform HDDs, thus improving the performance of the RAID 1 array and consequently enhancing the performance of the KOS system pre-installed on the created RAID 1 array.
[0117] In summary, the order in which the array card and the disks paired with the array card are selected for creating a RAID array in this application can be as follows: Figure 2 As shown.
[0118] Secondly, before creating a RAID array, this application determines the following data: the type of RAID card, its index number, and the model of the disks paired with it. Based on the RAID card type and index number, the RAID card used for RAID creation can be identified; based on the model of the disks paired with it, the disks used for RAID creation can be identified. Thus, a RAID array can be created based on the identified RAID card and its paired disks.
[0119] After determining the RAID card and the disks paired with it, the specific method for creating the RAID can be found in existing methods, and this application does not limit it. The focus of this application is to determine the RAID card and disks used to create the RAID.
[0120] The solution in this application is also applicable to situations where "one or more LSI RAID cards exist" in the server, or "one or more PMC RAID cards exist", or "one or more LSI RAID cards and one or more PMC RAID cards are mixed together".
[0121] After creating a RAID array, the KOS operating system can be automatically installed on the RAID array.
[0122] This application enables fully automated determination of which RAID array card and its associated disk to create the RAID array, eliminating the need for human intervention. This reduces manual workload and labor costs. Furthermore, the elimination of human intervention overcomes the possibility of human error, thereby improving the accuracy and efficiency of the determination process.
[0123] Secondly, a unified determination method is used for all batches of servers that need to be shipped. The granularity of the determination method is all servers, not just the batch of production servers. Different determination methods do not need to be set for different batches of servers. The number of determination methods that need to be set is small. Thus, the workload required to set the determination method is low and the method is highly universal.
[0124] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0125] Reference Figure 3 The diagram illustrates a structural block diagram of an apparatus for creating RAID according to an embodiment of the present invention, applied to a server. The apparatus includes: The first detection module 11 is used to detect whether there is a first RAID card in the server that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disks are at least solid-state drives or hard disk drives. The first creation module 12 is used to create RAID1 based on the first array card and the two disks paired with the first array card when there is a first array card in the server that is paired with only two disks. or, The second detection module 13 is used to detect whether there is a second array card with only one disk in the server when there is no first array card with only two disks in the server. The second creation module 14 is used to create RAID0 based on the second array card and the disk paired with the second array card when there is a second array card in the server that is paired with only one disk. or, The third detection module 15 is used to detect whether there is a third RAID card with three or more disks in the server when there is no second RAID card with only one disk in the server. The third creation module 16 is used to create RAID1 based on the third array card and two disks of the same type among the three or more disks paired with the third array card when there is a third array card in the server with three or more disks.
[0126] In one alternative implementation, there are multiple first RAID cards in the server that are paired with only two disks; The first creation module includes: The first detection unit is used to detect whether there is a first array card with two solid-state drives among the multiple first array cards; The first creation unit is used to create RAID1 based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card when there are multiple first array cards with two solid-state drives. or, The second detection unit is used to detect whether there is a first array card with two mechanical hard drives among the multiple first array cards when there is no first array card with two solid-state drives among the multiple first array cards. The second creation unit is used to create RAID1 based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card when there are multiple first array cards.
[0127] In one optional implementation, there are at least two first RAID cards with two solid-state drives; The first creation unit includes: The first selection subunit is used to select the first RAID card with the lowest total capacity of the paired solid-state drives from at least two first RAID cards paired with two solid-state drives. The first creation sub-unit is used to create RAID 1 based on the selected first RAID card and the two solid-state drives paired with the selected first RAID card.
[0128] In one optional implementation, there are at least two first RAID cards equipped with two mechanical hard drives; The second creation unit includes: The second selection subunit is used to select the first RAID card with the lowest total capacity of the paired mechanical hard drives from at least two first RAID cards paired with two mechanical hard drives. The second creation sub-unit is used to create RAID1 based on the selected first RAID card and the two mechanical hard drives paired with the selected first RAID card.
[0129] In one alternative implementation, there are multiple second RAID cards in the server, each paired with a disk. The second creation module includes: The third detection unit is used to detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; The third creation unit is used to create RAID0 based on the second array card with a solid-state drive and the solid-state drive associated with the second array card when there is a second array card with a solid-state drive among multiple second array cards; or, The fourth detection unit is used to detect whether there is a second array card with a mechanical hard drive among the multiple second array cards when there is no second array card with a solid-state drive among the multiple second array cards. The fourth creation unit is used to create RAID0 based on the second array card with a mechanical hard drive and the mechanical hard drive associated with the second array card with a mechanical hard drive when there are multiple second array cards.
[0130] In one optional implementation, there are at least two second RAID cards, each equipped with a solid-state drive. The third creation unit includes: The third selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one solid-state drive; The third creation sub-unit is used to create RAID 0 based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
[0131] In one optional implementation, at least two second RAID cards are used, each paired with a mechanical hard drive. The fourth creation unit includes: The fourth selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one mechanical hard drive; The fourth creation sub-unit is used to create RAID 0 based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
[0132] In one alternative implementation, there are multiple third RAID cards in the server, each with three or more disks. The third creation module includes: The fifth detection unit is used to detect whether there are any third RAID cards with paired disks, including two solid-state drives; The fifth creation unit is used to create RAID1 based on the third array card with two solid-state drives and the two solid-state drives associated with the third array card when there are multiple third array cards with paired disks including two solid-state drives. or, The sixth detection unit is used to detect whether there is a third RAID card with two mechanical hard drives among the multiple third RAID cards when there is no matching disk among the multiple third RAID cards. The sixth creation unit is used to create RAID1 based on the third RAID card with two mechanical hard drives and the two mechanical hard drives associated with the third RAID card when there are multiple third RAID cards with paired disks.
[0133] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two solid-state drives. The fifth creation unit includes: The fifth selection subunit is used to select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks, including two solid-state drives. The fifth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two solid-state drives paired with the selected third RAID card.
[0134] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The sixth creation unit includes: The sixth selection subunit is used to select the third RAID card with the lowest total capacity of the two paired hard disks among at least two paired disks, including two mechanical hard disks. The sixth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two mechanical hard drives paired with the selected third RAID card.
[0135] This application enables fully automated determination of which RAID array card and its associated disk to create the RAID array, eliminating the need for human intervention. This reduces manual workload and labor costs. Furthermore, the elimination of human intervention overcomes the possibility of human error, thereby improving the accuracy and efficiency of the determination process.
[0136] Secondly, a unified determination method is used for all batches of servers that need to be shipped. The granularity of the determination method is all servers, not just the batch of production servers. Different determination methods do not need to be set for different batches of servers. The number of determination methods that need to be set is small. Thus, the workload required to set the determination method is low and the method is highly universal.
[0137] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0138] Figure 4 This is a structural block diagram illustrating an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0139] Reference Figure 4 The electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.
[0140] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
[0141] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0142] Power supply component 706 provides power to various components of electronic device 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.
[0143] Multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0144] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
[0145] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0146] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 may detect the on / off state of device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or a component of electronic device 700, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0147] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0148] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0149] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of an electronic device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0150] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a server's processor, enables the server to perform a method for creating a RAID array, applied to the server, the method comprising: The server is checked to see if a first RAID card exists that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disks are at least solid-state drives or hard disk drives. In the case where a first RAID card exists in the server and is paired with only two disks, RAID1 is created based on the first RAID card and the two disks paired with the first RAID card. or, If there is no first RAID card in the server that is paired with only two disks, check if there is a second RAID card in the server that is paired with only one disk. In the case where a second RAID card exists in the server and is paired with only one disk, create a RAID0 array based on the second RAID card and the disk paired with the second RAID card. or, If there is no second RAID card in the server and it is only equipped with one disk, check if there is a third RAID card in the server equipped with three or more disks; In the case of a server with a third RAID card that has three or more disks, RAID1 is created based on the third RAID card and two disks of the same type from the three or more disks that the third RAID card is paired with.
[0151] In one alternative implementation, there are multiple first RAID cards in the server that are paired with only two disks; The process of creating RAID1 based on the first RAID card and the two disks paired with the first RAID card includes: Detect whether there is a first RAID card with two solid-state drives among multiple first RAID cards; In the case where there is a first array card with two solid-state drives among multiple first array cards, RAID1 is created based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card with two solid-state drives. or, In the case where there is no RAID card with two solid-state drives among the multiple RAID cards, detect whether there is a RAID card with two mechanical hard drives among the multiple RAID cards; In the case where there is a first array card with two mechanical hard drives among multiple first array cards, RAID1 is created based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card with two mechanical hard drives.
[0152] In one optional implementation, there are at least two first RAID cards with two solid-state drives; The creation of RAID 1 based on a first RAID card with two solid-state drives and the two solid-state drives paired with the first RAID card with two solid-state drives includes: Choose the first RAID card with the lowest total capacity among at least two RAID cards that are paired with two solid-state drives; Create a RAID 1 array based on the selected first RAID card and the two solid-state drives paired with it.
[0153] In one optional implementation, there are at least two first RAID cards equipped with two mechanical hard drives; The process of creating RAID 1 based on a first RAID card with two hard drives and the two hard drives paired with the first RAID card with two hard drives includes: Choose the RAID card with the lowest total capacity among at least two RAID cards that are paired with two mechanical hard drives; Create a RAID 1 array based on the selected first RAID card and the two mechanical hard drives paired with it.
[0154] In one alternative implementation, there are multiple second RAID cards in the server, each paired with a disk. The process of creating RAID 0 based on the second RAID card and a disk paired with the second RAID card includes: Detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; In the case where there is a second RAID card with a solid-state drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a solid-state drive and the solid-state drive paired with the second RAID card with a solid-state drive. or, If there is no second RAID card with a solid-state drive among the multiple second RAID cards, check if there is a second RAID card with a mechanical hard drive among the multiple second RAID cards; In the case where there is a second RAID card with a mechanical hard drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a mechanical hard drive and the mechanical hard drive paired with the second RAID card with a mechanical hard drive.
[0155] In one optional implementation, there are at least two second RAID cards, each equipped with a solid-state drive. The creation of RAID 0 based on a second RAID card with a solid-state drive and a solid-state drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one solid-state drive; Create a RAID 0 array based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
[0156] In one optional implementation, at least two second RAID cards are used, each paired with a mechanical hard drive. The creation of RAID 0 based on a second RAID card with a mechanical hard drive and a mechanical hard drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one mechanical hard drive; Create a RAID 0 array based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
[0157] In one alternative implementation, there are multiple third RAID cards in the server, each with three or more disks. The creation of RAID 1 based on a third RAID card and two or more disks of the same type paired with the third RAID card includes: Detecting whether there are paired disks, including two solid-state drives, in multiple third-party RAID cards; In the case where there are multiple third RAID cards, there is a third RAID card with two solid-state drives as its paired disks, and a third RAID card with two solid-state drives paired with two solid-state drives is used to create RAID1. or, In the case where there is no third RAID card with paired disks including two solid-state drives among multiple third RAID cards, detect whether there is a third RAID card with paired disks including two hard disks among multiple third RAID cards. In the case where there are multiple third-array cards with paired disks including two mechanical hard drives, RAID1 is created based on the third-array card with paired disks including two mechanical hard drives and the two mechanical hard drives paired with the third-array card with paired disks including two mechanical hard drives.
[0158] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two solid-state drives. The step of creating RAID 1 based on a third RAID card with two solid-state drives (SSDs) and the two SSDs paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two solid-state drives paired with it.
[0159] In one optional implementation, the accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The creation of RAID 1 based on a third RAID card with two mechanical hard drives and the two mechanical hard drives paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two mechanical hard drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two mechanical hard drives paired with it.
[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0161] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0165] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0166] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0167] The foregoing has provided a detailed description of a method for creating RAID, a device for creating RAID, an electronic device, and a readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for creating a RAID array, characterized in that, Applied to a server, the method includes: The server is checked to see if a first RAID card exists that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disks are at least solid-state drives or hard disk drives. In the case where a first RAID card exists in the server and is paired with only two disks, RAID1 is created based on the first RAID card and the two disks paired with the first RAID card. or, If there is no first RAID card in the server that is paired with only two disks, check if there is a second RAID card in the server that is paired with only one disk. In the case where a second RAID card exists in the server and is paired with only one disk, create a RAID0 array based on the second RAID card and the disk paired with the second RAID card. or, If there is no second RAID card in the server and it is only equipped with one disk, check if there is a third RAID card in the server equipped with three or more disks; In the case of a server with a third RAID card that has three or more disks, RAID1 is created based on the third RAID card and two disks of the same type from the three or more disks that the third RAID card is paired with.
2. The method according to claim 1, characterized in that, There are multiple first RAID cards in the server that are paired with only two disks; The process of creating RAID1 based on the first RAID card and the two disks paired with the first RAID card includes: Detect whether there is a first RAID card with two solid-state drives among multiple first RAID cards; In the case where there is a first array card with two solid-state drives among multiple first array cards, RAID1 is created based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card with two solid-state drives. or, In the case where there is no RAID card with two solid-state drives among the multiple RAID cards, detect whether there is a RAID card with two mechanical hard drives among the multiple RAID cards; In the case where there is a first array card with two mechanical hard drives among multiple first array cards, RAID1 is created based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card with two mechanical hard drives.
3. The method according to claim 2, characterized in that, The first RAID card should have at least two solid-state drives; The creation of RAID 1 based on a first RAID card with two solid-state drives and the two solid-state drives paired with the first RAID card with two solid-state drives includes: Choose the first RAID card with the lowest total capacity among at least two RAID cards that are paired with two solid-state drives; Create a RAID 1 array based on the selected first RAID card and the two solid-state drives paired with it.
4. The method according to claim 2, characterized in that, The first RAID card should be equipped with at least two mechanical hard drives. The process of creating RAID 1 based on a first RAID card with two hard drives and the two hard drives paired with the first RAID card with two hard drives includes: Choose the RAID card with the lowest total capacity among at least two RAID cards that are paired with two mechanical hard drives; Create a RAID 1 array based on the selected first RAID card and the two mechanical hard drives paired with it.
5. The method according to claim 1, characterized in that, There are multiple second RAID cards in a server that each have a single disk; The process of creating RAID 0 based on the second RAID card and a disk paired with the second RAID card includes: Detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; In the case where there is a second RAID card with a solid-state drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a solid-state drive and the solid-state drive paired with the second RAID card with a solid-state drive. or, If there is no second RAID card with a solid-state drive among the multiple second RAID cards, check if there is a second RAID card with a mechanical hard drive among the multiple second RAID cards; In the case where there is a second RAID card with a mechanical hard drive among multiple second RAID cards, RAID0 is created based on the second RAID card with a mechanical hard drive and the mechanical hard drive paired with the second RAID card with a mechanical hard drive.
6. The method according to claim 5, characterized in that, A minimum of two RAID cards are required, each paired with a solid-state drive. The creation of RAID 0 based on a second RAID card with a solid-state drive and a solid-state drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one solid-state drive; Create a RAID 0 array based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
7. The method according to claim 5, characterized in that, At least two RAID cards are required, each paired with a mechanical hard drive. The creation of RAID 0 based on a second RAID card with a mechanical hard drive and a mechanical hard drive paired with the second RAID card includes: Choose the second RAID card with the lowest capacity among at least two second RAID cards that are paired with one mechanical hard drive; Create a RAID 0 array based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
8. The method according to claim 1, characterized in that, There are multiple third-array cards in a server that are equipped with three or more disks. The creation of RAID 1 based on a third RAID card and two or more disks of the same type paired with the third RAID card includes: Detecting whether there are paired disks, including two solid-state drives, in multiple third-party RAID cards; In the case where there are multiple third RAID cards, there is a third RAID card with two solid-state drives as its paired disks, and a third RAID card with two solid-state drives paired with it creates RAID1. or, In the case where there is no third RAID card with paired disks including two solid-state drives among multiple third RAID cards, detect whether there is a third RAID card with paired disks including two mechanical hard drives among multiple third RAID cards. In the case where there are multiple third-array cards with paired disks including two mechanical hard drives, RAID1 is created based on the third-array card with paired disks including two mechanical hard drives and the two mechanical hard drives paired with the third-array card with paired disks including two mechanical hard drives.
9. The method according to claim 8, characterized in that, The accompanying disks include at least two third RAID cards, each containing two solid-state drives. The step of creating RAID 1 based on a third RAID card with two solid-state drives (SSDs) and the two SSDs paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two solid-state drives paired with it.
10. The method according to claim 8, characterized in that, The accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The creation of RAID 1 based on a third RAID card with two mechanical hard drives and the two mechanical hard drives paired with the third RAID card includes: Select the third RAID card with the lowest total capacity of the two mechanical hard drives among at least two paired disks; Create a RAID 1 array based on the selected third RAID card and the two mechanical hard drives paired with it.
11. An apparatus for creating RAID, characterized in that, Applied to a server, the device includes: The first detection module is used to detect whether there is a first RAID card in the server that is paired with only two disks; the two disks paired with the first RAID card are of the same type; the disk type includes at least solid-state drives or hard disk drives. The first creation module is used to create RAID1 based on the first array card and the two disks paired with the first array card when there is a first array card in the server that is paired with only two disks. or, The second detection module is used to detect whether a second RAID card with only one disk exists in the server when there is no first RAID card with only two disks in the server. The second creation module is used to create RAID0 based on the second array card and the disk paired with the second array card when there is a second array card in the server that is paired with only one disk. or, The third detection module is used to detect whether there is a third RAID card with three or more disks in the server when there is no second RAID card with only one disk in the server. The third creation module is used to create RAID1 based on the third RAID card and two disks of the same type from the three or more disks that the third RAID card is paired with when there is a third RAID card in the server.
12. The apparatus according to claim 11, characterized in that, There are multiple first RAID cards in the server that are paired with only two disks; The first creation module includes: The first detection unit is used to detect whether there is a first array card with two solid-state drives among the multiple first array cards; The first creation unit is used to create RAID1 based on the first array card with two solid-state drives and the two solid-state drives paired with the first array card when there are multiple first array cards with two solid-state drives. or, The second detection unit is used to detect whether there is a first array card with two mechanical hard drives among the multiple first array cards when there is no first array card with two solid-state drives among the multiple first array cards. The second creation unit is used to create RAID1 based on the first array card with two mechanical hard drives and the two mechanical hard drives paired with the first array card when there are multiple first array cards.
13. The apparatus according to claim 12, characterized in that, The first RAID card should have at least two solid-state drives; The first creation unit includes: The first selection subunit is used to select the first RAID card with the lowest total capacity of the paired solid-state drives from at least two first RAID cards paired with two solid-state drives. The first creation sub-unit is used to create RAID 1 based on the selected first RAID card and the two solid-state drives paired with the selected first RAID card.
14. The apparatus according to claim 12, characterized in that, The first RAID card should be equipped with at least two mechanical hard drives. The second creation unit includes: The second selection subunit is used to select the first RAID card with the lowest total capacity of the paired mechanical hard drives from at least two first RAID cards paired with two mechanical hard drives. The second creation sub-unit is used to create RAID1 based on the selected first RAID card and the two mechanical hard drives paired with the selected first RAID card.
15. The apparatus according to claim 11, characterized in that, There are multiple second RAID cards in a server that each have a single disk; The second creation module includes: The third detection unit is used to detect whether there is a second RAID card with a solid-state drive among multiple second RAID cards; The third creation unit is used to create RAID0 based on the second array card with a solid-state drive and the solid-state drive associated with the second array card when there is a second array card with a solid-state drive among multiple second array cards; or, The fourth detection unit is used to detect whether there is a second array card with a mechanical hard drive among the multiple second array cards when there is no second array card with a solid-state drive among the multiple second array cards. The fourth creation unit is used to create RAID0 based on the second array card with a mechanical hard drive and the mechanical hard drive associated with the second array card with a mechanical hard drive when there are multiple second array cards.
16. The apparatus according to claim 15, characterized in that, A minimum of two RAID cards are required, each paired with a solid-state drive. The third creation unit includes: The third selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one solid-state drive; The third creation sub-unit is used to create RAID 0 based on the selected second RAID card and a solid-state drive paired with the selected second RAID card.
17. The apparatus according to claim 15, characterized in that, At least two RAID cards are required, each paired with a mechanical hard drive. The fourth creation unit includes: The fourth selection subunit is used to select the second RAID card with the lowest capacity among at least two second RAID cards paired with one mechanical hard drive; The fourth creation sub-unit is used to create RAID 0 based on the selected second RAID card and a mechanical hard drive paired with the selected second RAID card.
18. The apparatus according to claim 11, characterized in that, There are multiple third-array cards in a server that are equipped with three or more disks. The third creation module includes: The fifth detection unit is used to detect whether there are any third RAID cards with paired disks, including two solid-state drives; The fifth creation unit is used to create RAID1 based on the third array card with two solid-state drives and the two solid-state drives associated with the third array card when there are multiple third array cards with paired disks including two solid-state drives. or, The sixth detection unit is used to detect whether there is a third RAID card with two mechanical hard drives among the multiple third RAID cards when there is no matching disk among the multiple third RAID cards. The sixth creation unit is used to create RAID1 based on the third RAID card with two mechanical hard drives and the two mechanical hard drives associated with the third RAID card when there are multiple third RAID cards with paired disks.
19. The apparatus according to claim 18, characterized in that, The accompanying disks include at least two third RAID cards, each containing two solid-state drives. The fifth creation unit includes: The fifth selection subunit is used to select the third RAID card with the lowest total capacity of the two paired solid-state drives among at least two paired disks, including two solid-state drives. The fifth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two solid-state drives paired with the selected third RAID card.
20. The apparatus according to claim 18, characterized in that, The accompanying disks include at least two third RAID cards, each containing two mechanical hard drives. The sixth creation unit includes: The sixth selection sub-unit is used to select the third RAID card with the lowest total capacity of the two paired hard disks among at least two paired disks, including two mechanical hard disks. The sixth creation sub-unit is used to create RAID 1 based on the selected third RAID card and the two mechanical hard drives paired with the selected third RAID card.
21. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-10.
22. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method described in any one of claims 1-10.
Citation Information
Patent Citations
Magnetic disc adaptation card
CN101135950A
RAID customized creation method and system, terminal and storage medium
CN111475106A